package secondexecise;

public class BinaryTreeTest {
    public static void main(String[] args) {
        BinaryTree binaryTree = new BinaryTree();
        BinaryTree.TreeNode root = binaryTree.createTree();
        System.out.println(binaryTree.isCompleteTree(root));
    }
    public static void main1(String[] args) {
        BinaryTree binaryTree = new BinaryTree();
        BinaryTree.TreeNode root = binaryTree.createTree();
        System.out.println("前序遍历：");
        binaryTree.preOrder(root);
        System.out.println();
        System.out.println("节点个数1：");
        binaryTree.size1(root);
        System.out.println(binaryTree.sizeCount);
        System.out.println("节点个数2：");
        System.out.println(binaryTree.size2(root));
        System.out.println("叶子节点个数1：");
        binaryTree.getLeafCount1(root);
        System.out.println(binaryTree.leafCount);
        System.out.println("叶子节点个数2：");
        System.out.println(binaryTree.getLeafCount2(root));
        System.out.println("第k层节点的个数：");
        System.out.println(binaryTree.getKLeveCount(root, 3));
        System.out.println("树的高度：");
        System.out.println(binaryTree.getHeight(root));
        System.out.println("查找val节点：");
        BinaryTree.TreeNode node = binaryTree.find(root, 'H');
        System.out.println(node==null?null:node.val);
        System.out.println("层序遍历：");
        binaryTree.leveOrder(root);

    }
}
